import hasRole from './permission/hasRole'
import hasPermi from './permission/hasPermi'
import input from './input' // 输入框的限制
const directives = { input }
const install = function(Vue) {
  Vue.directive('hasRole', hasRole)
  Vue.directive('hasPermi', hasPermi)
  Object.keys(directives).forEach(key => {
    Vue.directive(key, directives[key])
  })
}

if (window.Vue) {
  window['hasRole'] = hasRole
  window['hasPermi'] = hasPermi
  window['input'] = input
  Vue.use(install); // eslint-disable-line
}

export default install
